This invention relates to data processing, and more particularly to the use of hierarchical information in the context of transformational systems.
Two trends in networked computing are the increasing use hierarchical information systems, such as the eXtensible Markup Language (XML) for information exchange among networked applications and the continuing and increasing use of relational database systems for managing businesses. These trends are likely to continue and accelerate in the future.
XML is widely used for exchanging hierarchical information in networked systems, such as local area networks, wide area networks, and the internet. XML has several characteristics that make it an attractive language for exchanging information among networked applications. First, XML is a text based language, so XML data streams are easily transported across systems with incompatible binary formats. Second, since information represented in XML is organized hierarchically, it allows a user to easily understand the relationships among the different types of information contained in an XML data stream.
Relational database systems provide access to a significant percentage of all the information stored in modern business information processing systems. Relational database systems also allow users of the data to easily access and process the information stored in the systems from both local and remote locations. Unfortunately, database queries executed against a relational database return information in the form of rowsets encoded either in binary or in nonstandard character format.
For these and other reasons there is a need for the present invention.
The above-mentioned shortcomings, disadvantages and problems are addressed by the present invention, which will be understood by reading and studying the following specification.
A database, such as a relational database, typically processes a query and returns rowsets to the process initiating the query. The present invention provides for the transformation of the rowsets into an XML data stream.
A request for an XML data stream is included in the query. The request specifies a mode for organizing the information returned in the XML data stream. In a first example mode primary-foreign key information is utilized in the transformation from the rowset to XML. For this mode, the returned rowsets are transformed into a graph. The graph is transformed into a tree, which defines the organization of the information included in the XML data stream, by using the primary-foreign key information. In a second example mode, the order of the tables in the query defines the organization of the XML data stream. In a third example mode, an explicit definition of the organization of the rowset stream is contained in the query. The definition includes nesting information. The rowsets returned from the query are in a universal table format which includes the aforementioned nesting information. The universal table is transformed into an XML data stream. The present invention is not limited to a rowset stream. A buffered rowset may also be used in connection with the present invention. In addition, the listed example modes are not intended to be an exhaustive list of modes in which the present invention may be practiced.
The invention includes systems, methods, computers, and computer-readable media of varying scope. Besides the embodiments, advantages and aspects of the invention described here, the invention also includes other embodiments, advantage and aspects, as will become apparent by reading and studying the drawings and the following description.